package com.heima.reggie.security;

import com.heima.reggie.mapper.EmployeeMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;
/**
  * 认证处理类
  */
@Service
public class EmployeeDetailsServiceImpl implements UserDetailsService {
    @Autowired
    private EmployeeMapper mapper;
    @Override
    public UserDetails loadUserByUsername(String s) throws UsernameNotFoundException {
        //根据用户名来查询用户信息
        System.out.println("根据用户名来查询用户信息....");
        return mapper.findByUername(s);
    }
}
